package Text;

import java.util.Scanner;

public class Text3 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int count=0;
        for(int i=1;i<=N;i++){
            int sum=0;
            sum=1;
            for(int j=1;j<=i;j++){
                sum*=j;
            }
             count+=sum;
        }
        System.out.println(count);
    }
}
